
package com.hzbc.faceattendance.face.alarm;

import com.hzbc.faceattendance.face.HCNetSDK;
import com.sun.jna.Pointer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class FMSGCallBack_V31 implements HCNetSDK.FMSGCallBack_V31 {
    private final AlarmDataParse alarmDataParse;

    @Autowired
    public FMSGCallBack_V31(AlarmDataParse alarmDataParse) {
        this.alarmDataParse = alarmDataParse;
    }
    //报警信息回调函数
    public boolean invoke(int lCommand, HCNetSDK.NET_DVR_ALARMER pAlarmer, Pointer pAlarmInfo, int dwBufLen, Pointer pUser) {
        alarmDataParse.alarmDataHandle(lCommand, pAlarmer, pAlarmInfo, dwBufLen, pUser);
        return true;
    }

    public FMSGCallBack_V31() {
        this.alarmDataParse = null;
    }
}